<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Credentials_model extends CI_Model{

	function validate($username, $password){
		$this->db->where('username', $username);
		$this->db->where('password', $password);
		$query = $this->db->get("creds");
		if($query->num_rows() > 0)
		{
			return true;
		}
			return false;
	}

	function is_logged_in(){
		$query =  $this->db->get('ci_sessions');
		//var_dump($foo);
		foreach ($query->result() as $row)
		{
		    return $row->user_data;
		}
	}

}
